﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MenuItemTask
{
    class Beverage : MenuItem
    {
        public Beverage(string name) : base(name)
        {

        }

        public double smallPrice;
        public double SmallPrice
        {
            get { return smallPrice; }
            private set
            {
                if (smallPrice < 0)
                {
                    Console.WriteLine("Ошибка! Введенное значение цены неверно.");
                }
                else
                {
                    smallPrice = value;
                }
            }
        }
        public double mediumPrice;
        public double MediumPrice
        {
            get { return smallPrice; }
            private set
            {
                if (smallPrice < 0)
                {
                    Console.WriteLine("Ошибка! Введенное значение цены неверно.");
                }
                else
                {
                    smallPrice = value;
                }
            }
        }
        public double largePrice;
        public double LargePrice
        {
            get { return smallPrice; }
            private set
            {
                if (smallPrice < 0)
                {
                    Console.WriteLine("Ошибка! Введенное значение цены неверно.");
                }
                else
                {
                    smallPrice = value;
                }
            }
        }

        public override void PrintToConsole()
        {
            Console.WriteLine("{0} - Small: {1}$, Medium: {2}$, Large: {3}$", name, smallPrice, mediumPrice, largePrice);
        }

        public Beverage(double smallPrice, double mediumPrice, double largePrice, string name) : base(name)
        {
            this.name = name;
            this.smallPrice = smallPrice;
            this.mediumPrice = mediumPrice;
            this.largePrice = largePrice;
        }
    }
}
